package com.jhgsys.internal.workflow.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.Date;

/**
 * 流程节点流向条件 Entity
 *
 * @author fenghaijun
 * @date 2024-07-19 09:56:38
 */
@Data
@TableName("workflow_node_trans_condition")
public class WorkflowNodeTransCondition implements Serializable {

    /**
     * 主键Id
     */
    @TableId(value = "workflow_node_trans_condition_id", type = IdType.ASSIGN_UUID)
    @Size(max = 32, message = "{noMoreThan}")
    private String workflowNodeTransConditionId;

    /**
     * 租户Id
     */
    @TableField("tenant_id")
    @NotBlank(message = "{required}")
    @Size(max = 32, message = "{noMoreThan}")
    private String tenantId;

    /**
     * 流程id
     */
    @TableField("workflow_id")
    @NotBlank(message = "{required}")
    @Size(max = 32, message = "{noMoreThan}")
    private String workflowId;

    /**
     * 流程节点流向id
     */
    @TableField("workflow_node_trans_id")
    @NotBlank(message = "{required}")
    @Size(max = 32, message = "{noMoreThan}")
    private String workflowNodeTransId;

    /**
     * 条件类型;1：发起人部门  2：发起人角色 3：审核操作（上一节点操作按钮）4：自定义（系统集成实现Class,返回true或者false）  5：业务字段
     */
    @TableField("condition_type")
    @NotBlank(message = "{required}")
    @Size(max = 1, message = "{noMoreThan}")
    private String conditionType;

    /**
     * 业务表
     */
    @TableField("business_table")
    private String businessTable;


    /**
     * 条件字段;部门Id、角色Id、按钮Id、实现类名、字段名
     */
    @TableField("condition_key")
    @NotBlank(message = "{required}")
    @Size(max = 255, message = "{noMoreThan}")
    private String conditionKey;

    /**
     * 对比;1：属于 2：不属于 3：大于 4：大于等于  5：小于  6：小于等于
     */
    @TableField("condition_operation")
    @NotBlank(message = "{required}")
    @Size(max = 1, message = "{noMoreThan}")
    private String conditionOperation;

    /**
     * 对比值
     */
    @TableField("condition_value")
    @Size(max = 255, message = "{noMoreThan}")
    private String conditionValue;

    /**
     * 创建人
     */
    @TableField("created_by")
    @Size(max = 32, message = "{noMoreThan}")
    private String createdBy;

    /**
     * 创建时间
     */
    @TableField("created_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createdTime;

    /**
     * 更新人
     */
    @TableField("updated_by")
    @Size(max = 32, message = "{noMoreThan}")
    private String updatedBy;

    /**
     * 更新时间
     */
    @TableField("updated_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updatedTime;

    /**
     * 删除人
     */
    @TableField("deleted_by")
    @Size(max = 32, message = "{noMoreThan}")
    private String deletedBy;

    /**
     * 删除时间
     */
    @TableField("deleted_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date deletedTime;

    /**
     * 删除标记
     */
    @TableField("deleted_flg")
    @Size(max = 1, message = "{noMoreThan}")
    private String deletedFlg;

}